package com.kefu.robot.vo;

import com.kefu.common.context.KefuContext;
import com.kefu.common.vo.AbstractInsertVo;
import cn.hutool.core.bean.BeanUtil;
import com.kefu.robot.model.RobotAidataDocType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

/**
 * @author xiaoyu
 * @date 2023/11/03
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@ApiModel(description = "AI模型词条分类表")
public class RobotAidataDocTypeInsertVo extends AbstractInsertVo<RobotAidataDocType> {

    @ApiModelProperty(value = "分类名称", required = true)
    private String name;
    @ApiModelProperty(value = "AI模型id", required = true)
    private String aidataId;
    //    @ApiModelProperty(value = "排序")
//    private Integer weight;
    @ApiModelProperty(value = "上级Id")
    private String parentId = "0";

    @Override
    public RobotAidataDocType convert() {
        RobotAidataDocType info = BeanUtil.toBean(this, RobotAidataDocType.class);
        KefuContext context = KefuContext.getKefuContext();
        info.setCreateUser(context.getUserId());
        info.setCreateTime(context.getNow());
        info.setUpdateUser(context.getUserId());
        info.setUpdateTime(context.getNow());
        info.setTenantId(context.getTenantId());
        return info;
    }
}